<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<a href="123" title="">百度百度</a>
	<script type="text/javascript">
		let a = document.getElementsByTagName("a")[0]
		// 读取属性getAttribute("属性名") 返回的是字符串
		console.log(a.getAttribute("href"))//123


		// 写入属性 setAttribute("属性名","属性值")
		a.setAttribute("title","鼠标放上去了")
	</script>
</body>
</html>